var t = getApp();

Component({
    properties: {
        item: {
            type: Array
        },
        info: {
            type: Object
        },
        storeId: null,
        plu: {
            type: String
        }
    },
    observers: {},
    data: {
        show: !1,
        teamInfo: [],
        uid: "",
        shareModel: {
            title: "",
            path: "",
            imageUrl: "",
            fromButton: ""
        }
    },
    lifetimes: {
        attached: function() {
            try {
                var t = wx.getStorageSync("yz_uid");
                this.setData({
                    uid: t
                });
            } catch (t) {
                console.log(t);
            }
        },
        moved: function() {},
        detached: function() {}
    },
    methods: {
        tapOverlay: function() {
            this.setData({
                show: !1
            });
        },
        getAllTeam: function(a) {
            var e = this, o = this.data.info.id, s = "fight-groups";
            "ywmGroup" == this.data.plu && (s = "ywm-fight-groups");
            var i = t.getNetAddresss("plugin.".concat(s, ".frontend.controllers.fight-groups-goods.all-team"));
            t._getNetWork({
                url: i,
                data: {
                    id: o
                },
                success: function(t) {
                    var a = t.data;
                    1 == a.result ? (e.setData({
                        isLoadMore: !0,
                        total_page: a.data.last_page,
                        teamInfo: a.data.data,
                        show: !0
                    }), e.data.total_page || e.setData({
                        total_page: 0
                    })) : wx.showToast({
                        icon: "none",
                        title: a.msg,
                        duration: 1500
                    });
                }
            });
        },
        clickAdd: function(a) {
            var e = this, o = (a.target.dataset.item || a.currentTarget.dataset.item, a.target.dataset.id || a.currentTarget.dataset.id), s = this, i = [];
            i.push(s.data.goodsId);
            var r = t.getNetAddresss("from.div-from.isDisplay");
            r += "&goods_ids=" + JSON.stringify(i), t._getNetWork({
                showToastIn: !1,
                url: r,
                success: function(t) {
                    var a = t.data;
                    if (1 == a.result) if (a.data.status && !a.data.member_status) wx.showModal({
                        title: "提示",
                        content: "购买此商品,请补充您的个人信息",
                        success: function(t) {
                            t.confirm && wx.navigateTo({
                                url: "/packageB/member/address/myinfo/myinfo?tag=group&activityId=" + s.data.activityId
                            });
                        }
                    }); else {
                        if ("ywmGroup" == e.data.plu) return void wx.navigateTo({
                            url: "/packageB/member/group/GroupDetail/GroupDetail?id=" + o + "&plu=ywm"
                        });
                        wx.navigateTo({
                            url: "/packageB/member/group/GroupDetail/GroupDetail?id=" + o + "&store_id=" + s.properties.storeId
                        });
                    } else wx.showToast({
                        icon: "none",
                        title: a.msg,
                        duration: 1500
                    });
                },
                fail: function(t) {}
            });
        }
    }
});